import {axios} from '@/utils/request'

// api接口列表
const api = {
    create: '/pay/app',
    edit: '/pay/app/{id}',
    delete: '/pay/app/{id}',
    list: '/pay/app',
    page: '/pay/app/page',
    changeStatus: '/pay/app/{id}/{status}',
}

export function add(data) {
    return axios({
        url: api.create,
        method: 'post',
        data
    })
}

export function edit(id, data) {
    return axios({
        url: api.edit.replace('{id}', id),
        method: 'put',
        data
    })
}

export function list() {
    return axios({
        url: api.list,
        method: 'get'
    })
}

export function deleted(id) {
    return axios({
        url: api.edit.replace('{id}', id),
        method: 'delete'
    })
}

export function page(params) {
    return axios({
        url: api.page,
        method: 'get',
        params
    })
}

export function changeAppStatus(id, status) {
    return axios({
        url: api.changeStatus.replace('{id}', id).replace('{status}', status),
        method: 'put'
    })
}
